#!/bin/sh
command=$1

ps aux | grep ssh | grep "${command}" | grep -v kill_ssh | awk '{print $2}' | while read ssh_pid; do
	#statements
	echo "will kill SSH process pid:${ssh_pid}"
	kill $ssh_pid > /dev/null
done
if [ "$command" == "rsync" ]; then
  echo "rsync local to service"
  exit 0
fi
ps aux | grep ssh | grep rsync | awk '{print $2}' | while read ssh_pid; do
	#statements
	echo "will kill SSH process pid:${ssh_pid}"
	kill $ssh_pid > /dev/null
done
exit 0